import request from '@/utils/request'

// 查询仓库列表
export function listWarehouses(query) {
  return request({
    url: '/wm/warehouses/list',
    method: 'get',
    params: query
  })
}
// 查询料品大类
export function materialSort() {
  return request({
    url: 'wm/warehouses/getSort',
    method: 'get',
    })
}
// 获取仓管员/操作员
export function mgrOperator(power) {
  return request({
    url: '/system/user/roleSysUser/',
    method: 'get',
      params: power
  })
}
// 获取出库/入库类型
export function inOutType (data) {
  return request({
    url: '/system/dict/data/type/'+ data,
    method: 'get',
  })

}
// 导出仓库
export function exportWarehouses(query) {
  return request({
    url: '/wm/warehouses/export',
    method: 'get',
    params: query
  })
}
// 新增仓库
export function addWarehouses(data) {
  return request({
    url: '/wm/warehouses/add',
    method: 'post',
    data: data
  })
}

// 修改仓库
export function updateWarehouses(data) {
  return request({
    url: '/wm/warehouses/edit',
    method: 'put',
    data: data
  })
}

// 删除仓库
export function delWarehouses(uniqueId) {
  return request({
    url: '/wm/warehouses/' + uniqueId,
    method: 'delete'
  })
}

// 查询货位树列表
export function listLocation(query) {
  return request({
    url: 'wm/location/list',
    method: 'get',
    params: query
  })
}

// 新增货位
export function addLocation(data) {
  return request({
    url: '/wm/location',
    method: 'post',
    data: data
  })
}

// 修改货位
export function updateLocation(data) {
  return request({
    url: '/wm/location',
    method: 'put',
    data: data
  })
}

// 删除分类
export function delLocation(locId) {
  return request({
    url: '/wm/location/' + locId,
    method: 'delete'
  })
}
